package com.kuizii.demo.core.convert;

import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

public class PageConvert {


    public static <T> Page<T> toPage(IPage<?> pageList, Class<T> clazz) {

        if (pageList == null) {
            return null;
        }
        return JSON.parseObject(JSON.toJSONString(pageList), (new Page<T>()).getClass());
    }

}
